package main

import (
	"git.oschina.net/zhufeng9282/go-micro-study/srv/user/db"
	"git.oschina.net/zhufeng9282/go-micro-study/srv/user/handler"
	"github.com/micro/go-log"
	"github.com/micro/go-micro"

	proto "git.oschina.net/zhufeng9282/go-micro-study/srv/user/proto"
)

func main() {
	// New Service
	service := micro.NewService(
		micro.Name("go-micro-study.srv.user"),
		micro.Version("latest"),
	)

	// Register Handler
	proto.RegisterAccountHandler(service.Server(), new(handler.Account))

	// Initialise service
	service.Init()
	db.Init()

	// Run service
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
